<template>
  <div class="counter-warp">
    <p>Vuex counter：{{ count }}</p>
    <p>
      <button @click="increment">+</button>
      <button @click="decrement">-</button>


      <button @click="handleWx">wx 请求方法</button>
      <button @click="handleFly">fly 请求方法</button>
    </p>
  </div>
</template>

<script>
  // Use Vuex
  import { mapState, mapGetters, mapActions } from 'vuex'
  import API from '../../http/api'

  export default {
    computed: {
      ...mapState('counter', [
        'count'
      ]),
      ...mapGetters('counter', [])
    },
    methods: {
      ...mapActions('counter', [
        'increment',
        'decrement'
      ]),
      handleWx () {
        console.log('handleWx')

        console.log(this.$http)

        this.$http.post({
          url: '/accountCity',
          data: {}
        }).then(res => {
          console.log(res)
        })
      },
      handleFly () {
        this.$fly.request({
          url:this.$api.REQUEST_METHOD['accountCity'],
          method:"post", //post/get 请求方式
          interfaceName:"accountCity",
          data: { },
        }).then(res => {
          console.log(res)
        })

      }
    }
  }
</script>

<style lang="less" scoped>
  @import "./index.less";
</style>
